﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Microsoft.Office.OneNote
{
    [OneNoteXmlElement("OE")]
    public sealed class OneNoteOutlineElement : OneNotePageObject
    {
        internal static readonly OneNoteProperty AlignmentProperty = OneNoteProperty.Register(
            "alignment", typeof(OneNoteAlignment), typeof(OneNoteOutlineElement));

        internal static readonly OneNoteProperty AuthorProperty = OneNoteProperty.Register(
            "author", typeof(String), typeof(OneNoteOutlineElement));

        internal static readonly OneNoteProperty BodyTextProperty = OneNoteProperty.Register(
            "bodyText", typeof(Boolean), typeof(OneNoteOutlineElement));


        internal static readonly OneNoteProperty CollapsedProperty = OneNoteProperty.Register(
            "collapsed", typeof(Boolean), typeof(OneNoteOutlineElement));

        internal static readonly OneNoteProperty CollapsedBodyTextProperty = OneNoteProperty.Register(
            "collapsedBodyText", typeof(Boolean), typeof(OneNoteOutlineElement));

        
        internal static readonly OneNoteProperty CreatedTimeProperty = OneNoteProperty.Register(
            "creationTime", typeof(DateTime), typeof(OneNoteOutlineElement));

        internal static readonly OneNoteProperty LastModifiedByProperty = OneNoteProperty.Register(
            "lastModifiedBy", typeof(String), typeof(OneNoteOutlineElement));

        internal static readonly OneNoteProperty OEChildrenProperty =
            OEChildren.RegisterProperty<OneNoteOutlineElement>();

        internal OneNoteOutlineElement(OneNoteObjectId id)
            : base(id)
        {
        }

        public OneNoteAlignment Alignment
        {
            get { return GetValue<OneNoteAlignment>(AlignmentProperty); }
            set { SetValue(AlignmentProperty, value); }
        }

        public String Author
        {
            get { return GetValue<String>(AuthorProperty); }
            set { SetValue(AuthorProperty, value); }
        }

        public Boolean BodyText
        {
            get { return GetValue<Boolean>(BodyTextProperty); }
            set { SetValue(BodyTextProperty, value); }
        }

        public Boolean Collapsed
        {
            get { return GetValue<Boolean>(CollapsedProperty); }
            set { SetValue(CollapsedProperty, value); }
        }

        public Boolean CollapsedBodyText
        {
            get { return GetValue<Boolean>(CollapsedBodyTextProperty); }
            set { SetValue(CollapsedBodyTextProperty, value); }
        }

        public DateTime CreatedTime
        {
            get { return GetValue<DateTime>(CreatedTimeProperty); }
            set { SetValue(CreatedTimeProperty, value); }
        }

        public String LastModifiedBy
        {
            get { return GetValue<String>(LastModifiedByProperty); }
            set { SetValue(LastModifiedByProperty, value); }
        }
    }
}
